﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:controls="clr-namespace:Brjnk.GpxExplorer.UI.Controls"
                    xmlns:l="clr-namespace:Brjnk.GpxExplorer.Localization"
                    xmlns:r="clr-namespace:Microsoft.Windows.Controls.Ribbon;assembly=RibbonControlsLibrary"
                    xmlns:vm="clr-namespace:Brjnk.GpxExplorer.ViewModel"
                    xmlns:workspace="clr-namespace:Brjnk.GpxExplorer.Workspace">
    <!--
        VAROVÁNÍ!!
        V komponentě Ribbon je chyba, která po změně šířky okna (v některých případech) způsobí nefunkčnosti Bindingu
        Proto některé prvky obsahují atribug DataContext="{Binding}", který (snad) problém odstraní.
        Problém byl zanamenán u Comboboxu, Checkboxu a Slideru.
        http://social.msdn.microsoft.com/Forums/vstudio/en-US/ca215e48-f946-4901-b5ed-07d0661de26c/binding-breaks-on-resize-ribbongroup-micorsoft-ribbon-for-combobox
    -->

    <r:Ribbon x:Key="ribbon"
              x:Name="ribbon"
              SelectedIndex="0">
        <!--  Nahrazení šablony pro hlavičku RibbonGroup. (Vyřeší oříznutí textu)  -->
        <r:Ribbon.Resources>
            <Style TargetType="r:RibbonGroup">
                <Setter Property="HeaderTemplate">
                    <Setter.Value>
                        <DataTemplate>
                            <Viewbox>
                                <TextBlock Text="{Binding}" />
                            </Viewbox>
                        </DataTemplate>
                    </Setter.Value>
                </Setter>
            </Style>
            <!--  Změní šablonu RibbonTwoLineText, výchozí šablonu se zobrazuje tak, že není vidět druhý řádek  -->
            <Style TargetType="r:RibbonTwoLineText">
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate>
                            <StackPanel Orientation="Horizontal">
                                <TextBlock Name="PART_TextBlock1" Margin="0" />
                                <TextBlock Name="PART_TextBlock2" Margin="2 0 0 0" />
                                <Path Name="PART_Path" />
                            </StackPanel>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>
        </r:Ribbon.Resources>

        <!--  Informace o verzi  -->
        <r:Ribbon.HelpPaneContent>
            <StackPanel Orientation="Horizontal">
                <TextBlock Text="{Binding VersionInfo.Version}" />
                <TextBlock Name="txbl"
                           Margin="5 0 5 0"
                           HorizontalAlignment="Right"
                           FontFamily="Consolas"
                           FontSize="16"
                           FontWeight="Bold"
                           Text="Beta"
                           Visibility="{Binding VersionInfo.IsBeta,
                                                Converter={StaticResource BooleanToVisibilityConverter}}">
                    <TextBlock.Foreground>
                        <SolidColorBrush />
                    </TextBlock.Foreground>
                    <TextBlock.Triggers>
                        <EventTrigger RoutedEvent="TextBlock.Loaded">
                            <BeginStoryboard>
                                <Storyboard>
                                    <ColorAnimationUsingKeyFrames Duration="0:0:1"
                                                                  RepeatBehavior="20x"
                                                                  Storyboard.TargetProperty="Foreground.Color">
                                        <DiscreteColorKeyFrame KeyTime="0:0:0" Value="Pink" />
                                        <DiscreteColorKeyFrame KeyTime="0:0:0.3" Value="Red" />
                                    </ColorAnimationUsingKeyFrames>
                                    <ColorAnimationUsingKeyFrames AutoReverse="false"
                                                                  BeginTime="0:0:20"
                                                                  RepeatBehavior="Forever"
                                                                  Storyboard.TargetProperty="Foreground.Color"
                                                                  Timeline.DesiredFrameRate="1">
                                        <LinearColorKeyFrame KeyTime="0:0:10" Value="Firebrick" />
                                        <LinearColorKeyFrame KeyTime="0:1:00" Value="Navy" />
                                        <LinearColorKeyFrame KeyTime="0:2:0" Value="Purple" />
                                        <LinearColorKeyFrame KeyTime="0:3:0" Value="Orchid" />
                                        <LinearColorKeyFrame KeyTime="0:4:0" Value="Yellow" />
                                        <LinearColorKeyFrame KeyTime="0:5:0" Value="Tomato" />
                                        <LinearColorKeyFrame KeyTime="0:6:0" Value="RoyalBlue" />
                                        <LinearColorKeyFrame KeyTime="0:7:0" Value="LimeGreen" />
                                        <LinearColorKeyFrame KeyTime="0:8:0" Value="Goldenrod" />
                                        <LinearColorKeyFrame KeyTime="0:9:0" Value="Crimson" />
                                        <LinearColorKeyFrame KeyTime="0:10:0" Value="Black" />
                                        <LinearColorKeyFrame KeyTime="0:11:0" Value="Gray" />
                                        <LinearColorKeyFrame KeyTime="0:12:0" Value="White" />
                                        <LinearColorKeyFrame KeyTime="0:13:0" Value="DarkOrange" />
                                        <LinearColorKeyFrame KeyTime="0:14:0" Value="Olive" />
                                        <LinearColorKeyFrame KeyTime="0:15:0" Value="SpringGreen" />
                                        <LinearColorKeyFrame KeyTime="0:16:0" Value="Firebrick" />
                                    </ColorAnimationUsingKeyFrames>
                                </Storyboard>
                            </BeginStoryboard>
                        </EventTrigger>
                    </TextBlock.Triggers>
                </TextBlock>
            </StackPanel>
        </r:Ribbon.HelpPaneContent>

        <!--  Skrýt Application Menu  -->
        <r:Ribbon.ApplicationMenu>
            <r:RibbonApplicationMenu Visibility="Collapsed" />
        </r:Ribbon.ApplicationMenu>

        <r:Ribbon.QuickAccessToolBar>
            <r:RibbonQuickAccessToolBar />
        </r:Ribbon.QuickAccessToolBar>

        <!--  Záložka Domů  -->
        <r:RibbonTab Header="{l:Loc tabHome}">
            <r:RibbonGroup Header="{l:Loc homeImport}">
                <r:RibbonContentPresenter>
                    <r:RibbonContentPresenter.Content>
                        <ItemsControl DataContext="{Binding}" ItemsSource="{Binding Path=DataManager.Sources}">
                            <ItemsControl.ItemsPanel>
                                <ItemsPanelTemplate>
                                    <StackPanel Orientation="Horizontal" />
                                </ItemsPanelTemplate>
                            </ItemsControl.ItemsPanel>
                            <ItemsControl.ItemTemplate>
                                <DataTemplate>
                                    <StackPanel>
                                        <r:RibbonButton Command="{Binding ElementName=RootWindow,
                                                                          Path=DataContext.DataManager.ImportCommand}"
                                                        CommandParameter="{Binding Path=DirectoryPath}"
                                                        Label="{Binding Path=Name}"
                                                        LargeImageSource="/Resources/Icons/Device.png" />
                                    </StackPanel>
                                </DataTemplate>
                            </ItemsControl.ItemTemplate>
                        </ItemsControl>
                    </r:RibbonContentPresenter.Content>
                </r:RibbonContentPresenter>
                <r:RibbonButton Command="{Binding Path=DataManager.ImportCommand}"
                                Label="{l:Loc homeImportGpx}"
                                LargeImageSource="/Resources/Icons/Import.png" />
                <r:RibbonButton Label="{l:Loc homeGCBrowser}" LargeImageSource="/Resources/Icons/GCBrowser.png"
                    Command="{Binding DataManager.OpenGCBrowserCommand}" />
                <r:RibbonSplitButton Label="{l:Loc homeGpxSamples}" LargeImageSource="/Resources/Icons/Sample.png">
                    <r:RibbonSplitMenuItem Command="{Binding DataManager.ImportSampleCommand}"
                                           CommandParameter="BusStopsPrague.xml"
                                           Header="{l:Loc sampleBusStopsPragueBenchmark}" />
                    <r:RibbonSplitMenuItem Command="{Binding DataManager.ImportSampleCommand}"
                                           CommandParameter="D1.gpx"
                                           Header="{l:Loc sampleD1}" />
                </r:RibbonSplitButton>
            </r:RibbonGroup>

            <!--  Zoom  -->
            <r:RibbonGroup Header="{l:Loc homeZoom}">
                <controls:ZoomControl Grid.ColumnSpan="2"
                                      Width="100"
                                      Height="30"
                                      Margin="5"
                                      DecreaseCommand="{Binding ViewManager.ZoomOutCommand}"
                                      IncreaseCommand="{Binding ViewManager.ZoomInCommand}"
                                      DataContext="{Binding}" />
                <!--  <TextBlock Text="{Binding ViewManager.Zoom}" HorizontalAlignment="Center" />  -->
                <Grid DataContext="{Binding}" Visibility="{Binding DataView.GraphMode, Converter={StaticResource BooleanToVisibilityConverter}}">
                    <Grid.RowDefinitions>
                        <RowDefinition />
                        <RowDefinition />
                    </Grid.RowDefinitions>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="30" />
                        <ColumnDefinition />
                    </Grid.ColumnDefinitions>
                    <!--  <TextBlock Grid.Row="0" Text="{l:Loc x, Binding={Binding ViewManager.ZoomX}}" />  -->
                    <controls:ZoomControl Grid.Row="0"
                                          Grid.Column="1"
                                          Width="50"
                                          Height="15"
                                          Margin="5"
                                          DecreaseCommand="{Binding ViewManager.ZoomOutXCommand}"
                                          IncreaseCommand="{Binding ViewManager.ZoomInXCommand}" />
                    <!--  <TextBlock Grid.Row="1" Text="{l:Loc y, Binding={Binding ViewManager.ZoomY}}" />  -->
                    <controls:ZoomControl Grid.Row="1"
                                          Grid.Column="1"
                                          Width="50"
                                          Height="15"
                                          Margin="5"
                                          DecreaseCommand="{Binding ViewManager.ZoomOutYCommand}"
                                          IncreaseCommand="{Binding ViewManager.ZoomInYCommand}" />
                </Grid>
            </r:RibbonGroup>

            <!--  Vyhledávání  -->
            <r:RibbonGroup Header="{l:Loc homeSearching}">
                <r:RibbonButton Command="{Binding SearchService.ShowSearchListCommand}"
                                Label="{l:Loc homeShowSearchList}"
                                LargeImageSource="/Resources/Icons/List2.png" />
                <r:RibbonButton Command="{Binding SearchService.SearchPositionCommand}"
                                Label="{l:Loc homeSearchPosition}"
                                SmallImageSource="/Resources/Icons/CoordinatesSmall.png" />
                <r:RibbonButton Command="{Binding SearchService.SearchDateTimeCommand}"
                                Label="{l:Loc homeSearchDateTime}"
                                SmallImageSource="/Resources/Icons/Clock16.png" />
                <r:RibbonButton Command="{Binding SearchService.SearchPlaceCommand}" Label="{l:Loc homeSearchPlace}" />
                <r:RibbonButton Command="{Binding SearchService.PushpinsManager.RemovePushpinsCommand}"
                                Label="{l:Loc homeRemovePushpins}"
                                SmallImageSource="/Resources/Icons/RemovePushpin16.png" />
                <r:RibbonButton Command="{Binding SearchService.ShowSearchConfigurationCommand}"
                                Label="{l:Loc homeShowSearchConfiguration}"
                                SmallImageSource="/Resources/Icons/Configuration16.png" />
                <r:RibbonToggleButton IsChecked="{Binding SearchService.IsDisabled}"
                                      Label="{l:Loc homeDisableSearching}"
                                      SmallImageSource="/Resources/Icons/Disable.png">
                    <r:RibbonToggleButton.Style>
                        <Style TargetType="r:RibbonToggleButton">
                            <Style.Triggers>
                                <Trigger Property="IsChecked" Value="True">
                                    <Setter Property="Background" Value="Pink" />
                                </Trigger>
                            </Style.Triggers>
                        </Style>
                    </r:RibbonToggleButton.Style>
                </r:RibbonToggleButton>
            </r:RibbonGroup>

            <!--  Možnosti stopy  -->
            <r:RibbonGroup Header="{l:Loc homeTracksOptions}">

                <Grid>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="*" />
                    </Grid.RowDefinitions>
                    <r:RibbonCheckBox x:Name="trackHighlightChbx"
                                      Grid.Row="0"
                                      DataContext="{Binding}"
                                      IsChecked="{Binding DataView.HighlightEnabled}"
                                      Label="{l:Loc homeTrackColorHighlight}" />
                    <ComboBox Grid.Row="1"
                              DataContext="{Binding}"
                              IsEnabled="{Binding DataView.HighlightEnabled}"
                              SelectedItem="{Binding DataView.HighlightedAttribute}">
                        <x:StaticExtension Member="vm:TrackPointAttributeInfo.Distance" />
                        <x:StaticExtension Member="vm:TrackPointAttributeInfo.Duration" />
                        <x:StaticExtension Member="vm:TrackPointAttributeInfo.Elevation" />
                        <x:StaticExtension Member="vm:TrackPointAttributeInfo.Speed" />
                        <x:StaticExtension Member="vm:TrackPointAttributeInfo.VerticalSpeed" />
                        <x:StaticExtension Member="vm:TrackPointAttributeInfo.Acceleration" />
                    </ComboBox>
                    <!--  RibbonCombobox nebyl použit, protože občas neměnil vybranou hodnotu  -->

                    <Slider Grid.Row="2"
                            DataContext="{Binding}"
                            IsEnabled="{Binding DataView.HighlightEnabled}"
                            Maximum="0.8"
                            Minimum="0.2"
                            ToolTip="{l:Loc homeTrackHighlightLevel}"
                            Value="{Binding DataView.HighlightLevel}">
                        <Slider.LayoutTransform>
                            <ScaleTransform ScaleY="0.8" />
                        </Slider.LayoutTransform>
                    </Slider>
                </Grid>

                <r:RibbonCheckBox DataContext="{Binding}"
                                  IsChecked="{Binding DataView.IncludeGaps}"
                                  Label="{l:Loc homeTrackIncludeGaps}" />
                <r:RibbonCheckBox DataContext="{Binding}"
                                  IsChecked="{Binding DataView.FillGaps}"
                                  Label="{l:Loc homeTrackFillGaps}" />
            </r:RibbonGroup>

            <r:RibbonGroup>
                <!--  Zobrazí debug informace  -->
                <r:RibbonButton Command="{Binding ShowSettingsCommand}"
                                Label="{l:Loc homeShowSettings}"
                                SmallImageSource="/Resources/Icons/configuration16.png" />
                <r:RibbonButton Command="{Binding ShowDebugWindowCommand}"
                                Label="Debug"
                                Visibility="{Binding Path=VersionInfo.IsDebug,
                                                     Converter={StaticResource BooleanToVisibilityConverter}}" />
                <r:RibbonButton Command="{Binding ShowAboutWindowCommand}"
                                Label="{l:Loc homeAbout}"
                                SmallImageSource="/Resources/Icons/Info16.png" />
                <r:RibbonButton Command="{Binding VersionInfo.CheckNewVersionCommand}"
                                Label="{l:Loc homeCheckVersion}"
                                SmallImageSource="/Resources/Icons/checkmark16.png" />
            </r:RibbonGroup>
        </r:RibbonTab>

        <!--  Záložka úpravy  -->
        <r:RibbonTab Header="{l:Loc tabEdit}">
            <r:RibbonGroup Header="{l:Loc editRemove}">
                <r:RibbonButton Command="{Binding DataManager.RemoveVisibleCommand}"
                                Label="{l:Loc editRemoveVisible}"
                                LargeImageSource="/Resources/Icons/RemoveVisible.png" />
                <r:RibbonButton Command="{Binding DataManager.RemoveHiddenCommand}"
                                Label="{l:Loc editRemoveInvisible}"
                                LargeImageSource="/Resources/Icons/RemoveHidden.png" />
            </r:RibbonGroup>
            <r:RibbonGroup Header="{l:Loc editAdd}">
                <r:RibbonButton Command="{Binding Editor.CreateWaypointCommand}"
                                Label="{l:Loc editAddWaypoint}"
                                LargeImageSource="/Resources/Icons/AddWaypoint.png" />
                <r:RibbonButton Command="{Binding Editor.CreateRouteCommand}"
                                Label="{l:Loc editCreateRoute}"
                                LargeImageSource="/Resources/Icons/AddRoute.png" />
                <r:RibbonButton Command="{Binding Editor.CreateTrackCommand}"
                                Label="{l:Loc editCreateTrack}"
                                LargeImageSource="/Resources/Icons/AddTrack.png" />
                <r:RibbonButton Command="{Binding Editor.CreateRouteFromWaypointsCommand}"
                                Label="{l:Loc editCreateRouteFromWaypoints}"
                                LargeImageSource="/Resources/Icons/AddRoute.png" />
            </r:RibbonGroup>
            <r:RibbonGroup>
                <r:RibbonButton Command="{Binding Editor.SortObjectsCommand}"
                                Label="{l:Loc editSortObjects}"
                                SmallImageSource="/Resources/Icons/Sort16.png" />
                <r:RibbonButton Command="{Binding Editor.InvertSelectionCommand}"
                                Label="{l:Loc editInvertSelection}"
                                SmallImageSource="/Resources/Icons/invert16.png" />
            </r:RibbonGroup>
            <!--  editace stopy  -->
            <r:RibbonGroup DataContext="{Binding Source={workspace:GetWorkspace}}" Header="{l:Loc editTrack, Binding={Binding Source={workspace:GetWorkspace}, Path=SelectedItem.Source.Name}}">
                <r:RibbonGroup.Style>
                    <Style BasedOn="{StaticResource ResourceKey={x:Type r:RibbonGroup}}" TargetType="r:RibbonGroup">
                        <Setter Property="Visibility" Value="Collapsed" />
                        <Style.Triggers>
                            <DataTrigger Binding="{Binding Source={workspace:GetWorkspace}, Path=SelectedItem, Converter={StaticResource GetTypeConverter}}" Value="{x:Type vm:TrackVM}">
                                <Setter Property="Visibility" Value="Visible" />
                            </DataTrigger>
                        </Style.Triggers>
                    </Style>
                </r:RibbonGroup.Style>
                <r:RibbonButton Command="{Binding Editor.ReverseTrackCommand}"
                                CommandParameter="{Binding SelectedItem}"
                                Label="{l:Loc editTrkReverse}"
                                SmallImageSource="/Resources/Icons/refresh16.png" />
                <r:RibbonButton Command="{Binding Editor.SimplifyTrackCommand}"
                                CommandParameter="{Binding SelectedItem}"
                                Label="{l:Loc editTrkSimplify}"
                                SmallImageSource="/Resources/Icons/package16.png" />
                <r:RibbonButton Command="{Binding Editor.FlattenTrackCommand}"
                                CommandParameter="{Binding SelectedItem}"
                                Label="{l:Loc editTrkFlatten}"
                                SmallImageSource="/Resources/Icons/link16.png" />
                <r:RibbonButton Command="{Binding Editor.RemoveTrackTimestampCommand}"
                                CommandParameter="{Binding SelectedItem}"
                                Label="{l:Loc editTrkRemoveTime}"
                                SmallImageSource="/Resources/Icons/editRemove16.png" />
                <r:RibbonButton Command="{Binding Editor.RemoveTrackElevationCommand}"
                                CommandParameter="{Binding SelectedItem}"
                                Label="{l:Loc editTrkRemoveElevation}"
                                SmallImageSource="/Resources/Icons/editRemove16.png" />
            </r:RibbonGroup>

            <!--  editace trasy  -->
            <r:RibbonGroup DataContext="{Binding Source={workspace:GetWorkspace}}" Header="{l:Loc editRoute, Binding={Binding Source={workspace:GetWorkspace}, Path=SelectedItem.Source.Name}}">
                <r:RibbonGroup.Style>
                    <Style BasedOn="{StaticResource ResourceKey={x:Type r:RibbonGroup}}" TargetType="r:RibbonGroup">
                        <Setter Property="Visibility" Value="Collapsed" />
                        <Style.Triggers>
                            <DataTrigger Binding="{Binding Source={workspace:GetWorkspace}, Path=SelectedItem, Converter={StaticResource GetTypeConverter}}" Value="{x:Type vm:RouteVM}">
                                <Setter Property="Visibility" Value="Visible" />
                            </DataTrigger>
                        </Style.Triggers>
                    </Style>
                </r:RibbonGroup.Style>
                <r:RibbonButton Command="{Binding Editor.ReverseRouteCommand}"
                                CommandParameter="{Binding SelectedItem}"
                                Label="{l:Loc editRteReverse}"
                                SmallImageSource="/Resources/Icons/refresh16.png" />
            </r:RibbonGroup>

            <!--  editace bodu  -->
            <r:RibbonGroup DataContext="{Binding Source={workspace:GetWorkspace}}" Header="{l:Loc editWaypoint, Binding={Binding Source={workspace:GetWorkspace}, Path=SelectedItem.Source.Name}}">
                <r:RibbonGroup.Style>
                    <Style BasedOn="{StaticResource ResourceKey={x:Type r:RibbonGroup}}" TargetType="r:RibbonGroup">
                        <Setter Property="Visibility" Value="Collapsed" />
                        <Style.Triggers>
                            <DataTrigger Binding="{Binding Source={workspace:GetWorkspace}, Path=SelectedItem, Converter={StaticResource GetTypeConverter}}" Value="{x:Type vm:WaypointVM}">
                                <Setter Property="Visibility" Value="Visible" />
                            </DataTrigger>
                        </Style.Triggers>
                    </Style>
                </r:RibbonGroup.Style>
            </r:RibbonGroup>
        </r:RibbonTab>

        <!--  Záložka fotografie  -->
        <r:RibbonTab DataContext="{Binding DataManager.PhotoManager}" Header="{l:Loc tabPhotos}">
            <r:RibbonGroup>
                <r:RibbonButton Command="{Binding LoadCommand}"
                                Label="{l:Loc photosLoad}"
                                LargeImageSource="/Resources/Icons/Import.png" />
                <r:RibbonButton Command="{Binding ManageCommand}"
                                Label="{l:Loc photosManage}"
                                LargeImageSource="/Resources/Icons/List2.png" />
            </r:RibbonGroup>
            <r:RibbonGroup Header="{l:Loc photosBrowse}">
                <r:RibbonButton Command="{Binding ShowAllCommand}"
                                Label="{l:Loc photosShowAll}"
                                LargeImageSource="/Resources/Icons/PhotosAll.png" />
                <r:RibbonButton Command="{Binding ShowLocatedCommand}"
                                Label="{l:Loc photosShowLocated}"
                                LargeImageSource="/Resources/Icons/PhotosOK.png" />
                <r:RibbonButton Command="{Binding ShowUnlocatedCommand}"
                                Label="{l:Loc photosShowUnlocated}"
                                LargeImageSource="/Resources/Icons/PhotosUnknown.png" />
                <r:RibbonButton Command="{Binding ShowAmbiguousCommand}"
                                Label="{l:Loc photosShowAmbiguous}"
                                LargeImageSource="/Resources/Icons/PhotosAmbiguous.png" />
            </r:RibbonGroup>
            <r:RibbonGroup Header="{l:Loc photosExport}">
                <r:RibbonButton Command="{Binding ExportCsvCommand}"
                                Label="{l:Loc photosCsv}"
                                LargeImageSource="/Resources/Icons/Csv.png" />
            </r:RibbonGroup>
            <r:RibbonGroup Header="{l:Loc photosStatistics}">
                <r:RibbonContentPresenter>
                    <r:RibbonContentPresenter.Content>
                        <StackPanel Orientation="Vertical">
                            <TextBlock Text="{l:Loc photosCountAll, Binding={Binding Photos.Collection.Count}}" />
                            <TextBlock Text="{l:Loc photosCountLocated, Binding={Binding Photos.LocatedCount}}" />
                        </StackPanel>
                    </r:RibbonContentPresenter.Content>
                </r:RibbonContentPresenter>
                <r:RibbonContentPresenter>
                    <r:RibbonContentPresenter.Content>
                        <StackPanel Orientation="Vertical">
                            <TextBlock DataContext="{Binding}" Text="{l:Loc photosCountUnlocated, Binding={Binding Photos.UnlocatedCount}}" />
                            <TextBlock Text="{l:Loc photosCountAmbiguous, Binding={Binding Photos.AmbiguousCount}}" />
                            <TextBlock Text="{l:Loc photosCountWithoutExif, Binding={Binding Photos.WithoutExifCount}}" />
                        </StackPanel>
                    </r:RibbonContentPresenter.Content>
                </r:RibbonContentPresenter>
            </r:RibbonGroup>
            <r:RibbonGroup DataContext="{Binding ElementName=RootWindow, Path=DataContext}" Header="{l:Loc Key=photosView}">
                <Slider Width="256"
                        DataContext="{Binding}"
                        Maximum="256"
                        Minimum="1"
                        ToolTip="{l:Loc photosPhotoSize}"
                        Value="{Binding AreaManager.PhotosLayer.RenderSize,
                                        Converter={StaticResource SizeDoubleConverter}}" />
                <r:RibbonCheckBox DataContext="{Binding}"
                                  IsChecked="{Binding AreaManager.PhotosLayer.GroupsEnabled}"
                                  Label="{l:Loc Key=photosGrouping}" />
            </r:RibbonGroup>
        </r:RibbonTab>

        <!--  Záložka Mapa  -->
        <r:RibbonTab Header="{l:Loc tabMap}">
            <r:RibbonGroup>
                <r:RibbonToggleButton IsChecked="{Binding DataView.MapMode}"
                                      Label="{l:Loc map}"
                                      LargeImageSource="/Resources/Icons/Map.png" />
                <r:RibbonToggleButton IsChecked="{Binding DataView.GraphMode}"
                                      Label="{l:Loc graph}"
                                      LargeImageSource="/Resources/Icons/chart.png" />
            </r:RibbonGroup>

            <r:RibbonGroup Name="mapSourceTab"
                           DataContext="{Binding}"
                           Header="{l:Loc mapMapSource}"
                           IsEnabled="{Binding DataView.MapMode}">
                <ComboBox Width="250"
                          DataContext="{Binding}"
                          DisplayMemberPath="SourceNameSerializable"
                          ItemsSource="{Binding MapManager.AllSources}"
                          SelectedItem="{Binding MapManager.Source}">
                    <ComboBox.ItemContainerStyle>
                        <Style TargetType="ComboBoxItem">
                            <Style.Triggers>
                                <DataTrigger Binding="{Binding IsInvalid}" Value="True">
                                    <Setter Property="Background" Value="Pink" />
                                </DataTrigger>
                            </Style.Triggers>
                        </Style>
                    </ComboBox.ItemContainerStyle>
                </ComboBox>

                <ItemsControl ItemsSource="{Binding MapManager.ZoomLevels}">
                    <ItemsControl.ItemsPanel>
                        <ItemsPanelTemplate>
                            <StackPanel Orientation="Horizontal" />
                        </ItemsPanelTemplate>
                    </ItemsControl.ItemsPanel>
                    <ItemsControl.ItemTemplate>
                        <DataTemplate>
                            <r:RibbonButton Command="{Binding DataContext.MapManager.SetZoomLevelCommand,
                                                              ElementName=RootWindow}"
                                            CommandParameter="{Binding}"
                                            Label="{Binding Num}" />
                        </DataTemplate>
                    </ItemsControl.ItemTemplate>
                </ItemsControl>

                <Grid Width="{Binding ElementName=mapSourceTab, Path=ActualWidth}" HorizontalAlignment="Stretch">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="*" />
                        <ColumnDefinition Width="Auto" />
                    </Grid.ColumnDefinitions>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                    </Grid.RowDefinitions>
                    <TextBlock Grid.Row="0" Text="{l:Loc mapInvalidMapSource}">
                        <TextBlock.Style>
                            <Style BasedOn="{StaticResource ErrorStyle}" TargetType="TextBlock">
                                <Style.Triggers>
                                    <DataTrigger Binding="{Binding MapManager.IsSourceValid}" Value="true">
                                        <Setter Property="Visibility" Value="Collapsed" />
                                    </DataTrigger>
                                </Style.Triggers>
                            </Style>
                        </TextBlock.Style>
                    </TextBlock>
                    <r:RibbonButton Grid.Row="1" Command="{Binding MapManager.ManageSourcesCommand}"
                                    Label="{l:Loc mapManageSources}"
                                    SmallImageSource="/Resources/Icons/List16.png" />

                    <TextBlock Grid.RowSpan="2" Grid.Column="1"
                               FontWeight="Bold"
                               Text="{Binding MapManager.ActualZoomNum}" />
                </Grid>
            </r:RibbonGroup>
            <r:RibbonGroup IsEnabled="{Binding DataView.MapMode}">
                <r:RibbonContentPresenter>
                    <r:RibbonContentPresenter.Content>
                        <controls:MapRotationPicker Angle="{Binding MapManager.Angle, UpdateSourceTrigger=PropertyChanged, Mode=OneWayToSource}" />
                    </r:RibbonContentPresenter.Content>
                </r:RibbonContentPresenter>
            </r:RibbonGroup>

            <r:RibbonGroup Header="{l:Loc mapStatistics}" IsEnabled="{Binding DataView.MapMode}">
                <r:RibbonButton Command="{Binding MapManager.ShowStatisticsCommand}"
                                Label="{l:Loc mapShowStatistics}"
                                LargeImageSource="/Resources/Icons/Statistics.png" />
            </r:RibbonGroup>
            <r:RibbonGroup IsEnabled="{Binding DataView.MapMode}">
                <r:RibbonButton Command="{Binding DataView.ResetViewCommand}"
                                Label="{l:Loc resetView}"
                                LargeImageSource="/Resources/Icons/View.png" />
            </r:RibbonGroup>

            <r:RibbonGroup Header="{l:Loc mapWebbrowserMaps}" IsEnabled="{Binding DataView.MapMode}">
                <r:RibbonContentPresenter>
                    <r:RibbonContentPresenter.Content>
                        <ItemsControl ItemsSource="{StaticResource WebbrowserMaps}">
                            <ItemsControl.ItemsPanel>
                                <ItemsPanelTemplate>
                                    <StackPanel Orientation="Horizontal" />
                                </ItemsPanelTemplate>
                            </ItemsControl.ItemsPanel>
                            <ItemsControl.ItemTemplate>
                                <DataTemplate>
                                    <r:RibbonButton Command="{Binding ElementName=RootWindow,
                                                                      Path=DataContext.MapManager.OpenInWebbrowserCommand}"
                                                    CommandParameter="{Binding Address}"
                                                    Label="{Binding Name}">
                                        <r:RibbonButton.LargeImageSource>
                                            <BitmapImage UriSource="{Binding IconUri}" />
                                        </r:RibbonButton.LargeImageSource>
                                    </r:RibbonButton>
                                </DataTemplate>
                            </ItemsControl.ItemTemplate>
                        </ItemsControl>
                    </r:RibbonContentPresenter.Content>
                </r:RibbonContentPresenter>
            </r:RibbonGroup>
        </r:RibbonTab>

        <!--  záložka Graf  -->
        <r:RibbonTab Header="{l:Loc tabGraph}">
            <r:RibbonGroup>
                <r:RibbonToggleButton DataContext="{Binding}"
                                      IsChecked="{Binding DataView.MapMode}"
                                      Label="{l:Loc map}"
                                      LargeImageSource="/Resources/Icons/Map.png" />
                <r:RibbonToggleButton DataContext="{Binding}"
                                      IsChecked="{Binding DataView.GraphMode}"
                                      Label="{l:Loc graph}"
                                      LargeImageSource="/Resources/Icons/Chart.png" />
            </r:RibbonGroup>

            <r:RibbonGroup DataContext="{Binding}"
                           Header="{l:Loc graphXAxis}"
                           IsEnabled="{Binding DataView.GraphMode}">
                <r:RibbonToggleButton IsChecked="{Binding DataView.GraphXDistance}" Label="{l:Loc graphXDistance}" />
                <r:RibbonToggleButton IsChecked="{Binding DataView.GraphXDistanceJoined}" Label="{l:Loc graphXDistanceJoined}" />
                <r:RibbonToggleButton IsChecked="{Binding DataView.GraphXDuration}" Label="{l:Loc graphXDuration}" />
                <r:RibbonToggleButton IsChecked="{Binding DataView.GraphXDurationJoined}" Label="{l:Loc graphXDurationJoined}" />
                <r:RibbonToggleButton IsChecked="{Binding DataView.GraphXDateTime}" Label="{l:Loc graphXDateTime}" />
            </r:RibbonGroup>

            <r:RibbonGroup DataContext="{Binding}"
                           Header="{l:Loc graphYAxis}"
                           IsEnabled="{Binding DataView.GraphMode}">
                <r:RibbonToggleButton IsChecked="{Binding DataView.GraphYDistance}" Label="{l:Loc graphYDistance}" />
                <r:RibbonToggleButton IsChecked="{Binding DataView.GraphYDuration}" Label="{l:Loc graphYDuration}" />
                <r:RibbonToggleButton IsChecked="{Binding DataView.GraphYElevation}" Label="{l:Loc graphYElevation}" />
                <r:RibbonToggleButton IsChecked="{Binding DataView.GraphYSpeed}" Label="{l:Loc graphYSpeed}" />
                <r:RibbonToggleButton IsChecked="{Binding DataView.GraphYVerticalSpeed}" Label="{l:Loc graphYVerticalSpeed}" />
                <r:RibbonToggleButton IsChecked="{Binding DataView.GraphYAcceleration}" Label="{l:Loc graphYAcceleration}" />
                <!--  <r:RibbonToggleButton IsChecked="{Binding DataView.GraphYSlope}" Label="{l:Loc graphYSlope}" />  -->
            </r:RibbonGroup>

            <r:RibbonGroup Header="{l:Loc graphOptions}">
                <r:RibbonGroup.IsEnabled>
                    <MultiBinding Converter="{StaticResource AndMultiConverter}">
                        <Binding Path="DataView.GraphMode" />
                        <Binding Converter="{StaticResource InvertConverter}" Path="SearchService.IsDisabled" />
                    </MultiBinding>
                </r:RibbonGroup.IsEnabled>
                <r:RibbonCheckBox DataContext="{Binding}"
                                  IsChecked="{Binding DataView.GraphShowWaypoints}"
                                  Label="{l:Loc graphShowWaypoints}" />
                <r:RibbonCheckBox DataContext="{Binding}"
                                  IsChecked="{Binding DataView.GraphShowPhotos}"
                                  Label="{l:Loc graphShowPhotos}" />
                <r:RibbonCheckBox DataContext="{Binding}"
                                  IsChecked="{Binding DataView.GraphShowSearchResults}"
                                  Label="{l:Loc graphShowSearchResults}" />
            </r:RibbonGroup>
            <r:RibbonGroup>
                <r:RibbonButton Command="{Binding DataView.ResetViewCommand}"
                                Label="{l:Loc resetView}"
                                LargeImageSource="/Resources/Icons/View.Png" />
            </r:RibbonGroup>
        </r:RibbonTab>

        <!--  Záložka Zobrazení  -->
        <r:RibbonTab Header="{l:Loc tabView}">
            <r:RibbonGroup Header="{l:Loc viewVisibility}">
                <Viewbox>
                    <Grid>
                        <Grid.RowDefinitions>
                            <RowDefinition />
                            <RowDefinition />
                            <RowDefinition />
                            <RowDefinition />
                        </Grid.RowDefinitions>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto" />
                            <ColumnDefinition Width="Auto" />
                            <ColumnDefinition Width="Auto" />
                        </Grid.ColumnDefinitions>

                        <r:RibbonButton Grid.Row="0"
                                        Grid.Column="0"
                                        Command="{Binding DataView.HideAllWaypointsCommand}"
                                        Label="{l:Loc viewHideAll}" />
                        <TextBlock Grid.Row="0"
                                   Grid.Column="1"
                                   Text="{l:Loc viewWaypoints}" />
                        <r:RibbonButton Grid.Row="0"
                                        Grid.Column="2"
                                        Command="{Binding DataView.ShowAllWaypointsCommand}"
                                        Label="{l:Loc viewShowAll}" />

                        <r:RibbonButton Grid.Row="1"
                                        Grid.Column="0"
                                        Command="{Binding DataView.HideAllRoutesCommand}"
                                        Label="{l:Loc viewHideAll}" />
                        <TextBlock Grid.Row="1"
                                   Grid.Column="1"
                                   Text="{l:Loc viewRoutes}" />
                        <r:RibbonButton Grid.Row="1"
                                        Grid.Column="2"
                                        Command="{Binding DataView.ShowAllRoutesCommand}"
                                        Label="{l:Loc viewShowAll}" />

                        <r:RibbonButton Grid.Row="2"
                                        Grid.Column="0"
                                        Command="{Binding DataView.HideAllTracksCommand}"
                                        Label="{l:Loc viewHideAll}" />
                        <TextBlock Grid.Row="2"
                                   Grid.Column="1"
                                   Text="{l:Loc viewTracks}" />
                        <r:RibbonButton Grid.Row="2"
                                        Grid.Column="2"
                                        Command="{Binding DataView.ShowAllTracksCommand}"
                                        Label="{l:Loc viewShowAll}" />

                        <r:RibbonButton Grid.Row="3"
                                        Grid.Column="0"
                                        Command="{Binding DataView.HideAllGCsCommand}"
                                        Label="{l:Loc viewHideAll}" />
                        <TextBlock Grid.Row="3"
                                   Grid.Column="1"
                                   Text="{l:Loc viewGCs}" />
                        <r:RibbonButton Grid.Row="3"
                                        Grid.Column="2"
                                        Command="{Binding DataView.ShowAllGCsCommand}"
                                        Label="{l:Loc viewShowAll}" />
                    </Grid>
                </Viewbox>
            </r:RibbonGroup>

            <r:RibbonGroup Header="{l:Loc viewWaypointStyle}">
                <r:RibbonCheckBox DataContext="{Binding}"
                                  IsChecked="{Binding DataView.WaypointStyle.ShowName}"
                                  Label="{l:Loc viewName}" />
                <r:RibbonCheckBox DataContext="{Binding}"
                                  IsChecked="{Binding DataView.WaypointStyle.ShowComment}"
                                  Label="{l:Loc viewComment}" />
                <r:RibbonCheckBox DataContext="{Binding}"
                                  IsChecked="{Binding DataView.WaypointStyle.ShowDescription}"
                                  Label="{l:Loc viewDescription}" />
                <r:RibbonCheckBox DataContext="{Binding}"
                                  IsChecked="{Binding DataView.WaypointStyle.ShowElevation}"
                                  Label="{l:Loc viewElevation}" />
                <r:RibbonCheckBox DataContext="{Binding}"
                                  IsChecked="{Binding DataView.WaypointStyle.ShowTime}"
                                  Label="{l:Loc viewTime}" />
                <r:RibbonCheckBox DataContext="{Binding}"
                                  IsChecked="{Binding DataView.WaypointStyle.ShowGCType}"
                                  Label="{l:Loc viewGCType}" />
                <r:RibbonCheckBox DataContext="{Binding}"
                                  IsChecked="{Binding DataView.WaypointStyle.ShowGCName}"
                                  Label="{l:Loc viewGCName}" />
                <r:RibbonCheckBox DataContext="{Binding}"
                                  IsChecked="{Binding DataView.WaypointStyle.ShowGCTDSize}"
                                  Label="{l:Loc viewGCTDSize}" />
                <TextBlock Text="{l:Loc viewFontSize}" />
                <Slider Width="100"
                        DataContext="{Binding}"
                        Maximum="50"
                        Minimum="1"
                        Value="{Binding DataView.WaypointStyle.FontSize}" />
            </r:RibbonGroup>

            <r:RibbonGroup Header="{l:Loc viewRouteWaypointStyle}">
                <r:RibbonCheckBox DataContext="{Binding}"
                                  IsChecked="{Binding DataView.RoutePointStyle.ShowNumber}"
                                  Label="{l:Loc viewNumber}" />
                <r:RibbonCheckBox DataContext="{Binding}"
                                  IsChecked="{Binding DataView.RoutePointStyle.ShowDistance}"
                                  Label="{l:Loc viewDistance}" />

                <TextBlock Text="{l:Loc viewFontSize}" />
                <Slider Width="100"
                        DataContext="{Binding}"
                        Maximum="50"
                        Minimum="1"
                        Value="{Binding DataView.RoutePointStyle.FontSize}" />
            </r:RibbonGroup>

            <r:RibbonGroup Header="{l:Loc viewTrackPointStyle}">
                <r:RibbonCheckBox DataContext="{Binding}"
                                  IsChecked="{Binding DataView.TrackPointStyle.ShowNumber}"
                                  Label="{l:Loc viewNumber}" />
                <r:RibbonCheckBox DataContext="{Binding}"
                                  IsChecked="{Binding DataView.TrackPointStyle.ShowDistance}"
                                  Label="{l:Loc viewDistance}" />
                <r:RibbonCheckBox DataContext="{Binding}"
                                  IsChecked="{Binding DataView.TrackPointStyle.ShowElevation}"
                                  Label="{l:Loc viewElevation}" />
                <r:RibbonCheckBox DataContext="{Binding}"
                                  IsChecked="{Binding DataView.TrackPointStyle.ShowDateTime}"
                                  Label="{l:Loc viewDateTime}" />
                <r:RibbonCheckBox DataContext="{Binding}"
                                  IsChecked="{Binding DataView.TrackPointStyle.ShowTime}"
                                  Label="{l:Loc viewTime}" />
                <r:RibbonCheckBox DataContext="{Binding}"
                                  IsChecked="{Binding DataView.TrackPointStyle.ShowDuration}"
                                  Label="{l:Loc viewDuration}" />

                <TextBlock Text="{l:Loc viewFontSize}" />
                <Slider Width="100"
                        DataContext="{Binding}"
                        Maximum="50"
                        Minimum="1"
                        Value="{Binding DataView.TrackPointStyle.FontSize}" />
            </r:RibbonGroup>

            <r:RibbonGroup Header="{l:Loc viewSearchPointStyle}">
                <r:RibbonCheckBox DataContext="{Binding}"
                                  IsChecked="{Binding DataView.SearchPointStyle.ShowDescription}"
                                  Label="{l:Loc viewDescription}" />

                <TextBlock Text="{l:Loc viewFontSize}" />
                <Slider Width="100"
                        DataContext="{Binding}"
                        Maximum="50"
                        Minimum="1"
                        Value="{Binding DataView.SearchPointStyle.FontSize}" />
            </r:RibbonGroup>

            <r:RibbonGroup Header="{l:Loc viewColors}">
                <r:RibbonButton Command="{Binding DataView.ChooseColorsCommand}"
                                DataContext="{Binding}"
                                LargeImageSource="/Resources/Icons/ChooseColor.png" />
            </r:RibbonGroup>
        </r:RibbonTab>

        <!--  Záložka Vrstvy  -->
        <r:RibbonTab Header="{l:Loc tabLayers}">
            <r:RibbonGroup Header="{l:Loc layersBackground}">
                <!--  Mapová vrstvá  -->
                <StackPanel Margin="5" Orientation="Horizontal">
                    <r:RibbonCheckBox DataContext="{Binding}" IsChecked="{Binding AreaManager.MapLayer.Visible}" />
                    <Slider Width="100"
                            DataContext="{Binding}"
                            Maximum="1"
                            Minimum="0.01"
                            Value="{Binding AreaManager.MapLayer.Opacity}" />
                    <TextBlock Text="{l:Loc layersMap}" />
                </StackPanel>
                <StackPanel Margin="5" Orientation="Horizontal">
                    <!--  Mřížka  -->
                    <r:RibbonCheckBox DataContext="{Binding}" IsChecked="{Binding AreaManager.GridLayer.Visible}" />
                    <Slider Width="100"
                            DataContext="{Binding}"
                            Maximum="1"
                            Minimum="0.01"
                            Value="{Binding AreaManager.GridLayer.Opacity}" />
                    <TextBlock Text="{l:Loc layersGrid}" />
                </StackPanel>
            </r:RibbonGroup>
            <r:RibbonGroup Header="{l:Loc layersRoutes}">
                <StackPanel Margin="5" Orientation="Horizontal">
                    <!--  Trasy (routes)  -->
                    <r:RibbonCheckBox DataContext="{Binding}" IsChecked="{Binding AreaManager.RoutesLayer.Visible}" />
                    <Slider Width="100"
                            DataContext="{Binding}"
                            Maximum="1"
                            Minimum="0.01"
                            Value="{Binding AreaManager.RoutesLayer.Opacity}" />
                    <TextBlock Text="{l:Loc layersRoutes}" />
                </StackPanel>

                <StackPanel Margin="5" Orientation="Horizontal">
                    <!--  Route Points  -->
                    <r:RibbonCheckBox DataContext="{Binding}" IsChecked="{Binding AreaManager.RoutePointsLayer.Visible}" />
                    <Slider Width="100"
                            DataContext="{Binding}"
                            Maximum="1"
                            Minimum="0.01"
                            Value="{Binding AreaManager.RoutePointsLayer.Opacity}" />
                    <TextBlock Text="{l:Loc layersRoutePoints}" />
                </StackPanel>
            </r:RibbonGroup>
            <r:RibbonGroup Header="{l:Loc layersTracks}">
                <StackPanel Margin="5" Orientation="Horizontal">
                    <!--  Stopy (tracks)  -->
                    <r:RibbonCheckBox DataContext="{Binding}" IsChecked="{Binding AreaManager.TracksLayer.Visible}" />
                    <Slider Width="100"
                            DataContext="{Binding}"
                            Maximum="1"
                            Minimum="0.01"
                            Value="{Binding AreaManager.TracksLayer.Opacity}" />
                    <TextBlock Text="{l:Loc layersTracks}" />
                </StackPanel>

                <StackPanel Margin="5" Orientation="Horizontal">
                    <!--  TrackPoints  -->
                    <r:RibbonCheckBox DataContext="{Binding}" IsChecked="{Binding AreaManager.TrackPointsLayer.Visible}" />
                    <Slider Width="100"
                            DataContext="{Binding}"
                            Maximum="1"
                            Minimum="0.01"
                            Value="{Binding AreaManager.TrackPointsLayer.Opacity}" />
                    <TextBlock Text="{l:Loc layersTrackPoints}" />
                </StackPanel>
            </r:RibbonGroup>
            <r:RibbonGroup Header="{l:Loc layersPoints}">

                <StackPanel Margin="5" Orientation="Horizontal">
                    <!--  Body (waypointy)  -->
                    <r:RibbonCheckBox DataContext="{Binding}" IsChecked="{Binding AreaManager.PointsLayer.Visible}" />
                    <Slider Width="100"
                            DataContext="{Binding}"
                            Maximum="1"
                            Minimum="0.01"
                            Value="{Binding AreaManager.PointsLayer.Opacity}" />
                    <TextBlock Text="{l:Loc layersPoints}" />
                </StackPanel>

                <StackPanel Margin="5" Orientation="Horizontal">
                    <!--  Fotografie  -->
                    <r:RibbonCheckBox DataContext="{Binding}" IsChecked="{Binding AreaManager.PhotosLayer.Visible}" />
                    <Slider Width="100"
                            DataContext="{Binding}"
                            Maximum="1"
                            Minimum="0.01"
                            Value="{Binding AreaManager.PhotosLayer.Opacity}" />
                    <TextBlock Text="{l:Loc layersPhotos}" />
                </StackPanel>
            </r:RibbonGroup>
            <r:RibbonGroup Header="{l:Loc layersSearchResults}">

                <StackPanel Margin="5" Orientation="Horizontal">
                    <!--  SearchResults  -->
                    <r:RibbonCheckBox DataContext="{Binding}" IsChecked="{Binding AreaManager.SearchResultsLayer.Visible}" />
                    <Slider Width="100"
                            DataContext="{Binding}"
                            Maximum="1"
                            Minimum="0.01"
                            Value="{Binding AreaManager.SearchResultsLayer.Opacity}" />
                    <TextBlock Text="{l:Loc layersSearchResults}" />
                </StackPanel>
            </r:RibbonGroup>
        </r:RibbonTab>

        <!--  Záložka Export  -->
        <r:RibbonTab Header="{l:Loc tabExport}">
            <r:RibbonGroup Header="{l:Loc exportGpx}">
                <r:RibbonButton Command="{Binding Path=DataManager.ExportGPXCommand}"
                                Label="{l:Loc exportGpx1_1}"
                                LargeImageSource="/Resources/Icons/Export.png" />
                <r:RibbonButton Command="{Binding Path=DataManager.ExportGCCommand}"
                                Label="{l:Loc exportGpxGeocaching}"
                                LargeImageSource="/Resources/Icons/ExportGC.png" />
            </r:RibbonGroup>
            <r:RibbonGroup Header="{l:Loc exportBitmap}">
                <r:RibbonButton Command="{Binding BitmapExporter.ExportBitmapCommand}"
                                Label="{l:Loc exportBitmapToFile}"
                                LargeImageSource="/Resources/Icons/ExportBitmapToFile.png" />
                <r:RibbonButton Command="{Binding BitmapExporter.ExportBitmapToClipboardCommand}"
                                Label="{l:Loc exportBitmapToClipboard}"
                                LargeImageSource="/Resources/Icons/ExportBitmapToClipboard.png" />
            </r:RibbonGroup>
            <!--  Tlačítka pro otevření dat v externí aplikaci  -->
            <r:RibbonGroup Header="{l:Loc externalApplications}">
                <r:RibbonContentPresenter>
                    <r:RibbonContentPresenter.Content>
                        <ItemsControl ItemsSource="{Binding Path=DataManager.AllExternalApplications}">
                            <ItemsControl.ItemsPanel>
                                <ItemsPanelTemplate>
                                    <StackPanel Orientation="Horizontal" />
                                </ItemsPanelTemplate>
                            </ItemsControl.ItemsPanel>
                            <ItemsControl.ItemTemplate>
                                <DataTemplate>
                                    <r:RibbonButton Command="{Binding RelativeSource={RelativeSource Mode=FindAncestor,
                                                                                                     AncestorType=ItemsControl},
                                                                      Path=DataContext.DataManager.OpenExternalApplicationCommand}"
                                                    CommandParameter="{Binding }"
                                                    Label="{Binding Name}"
                                                    LargeImageSource="{Binding Icon}">
                                        <r:RibbonButton.Style>
                                            <Style TargetType="r:RibbonButton">
                                                <Style.Triggers>
                                                    <DataTrigger Binding="{Binding Path=Warning}" Value="True">
                                                        <Setter Property="Background" Value="Pink" />
                                                    </DataTrigger>
                                                    <DataTrigger Binding="{Binding Path=IsAvailable}" Value="False">
                                                        <Setter Property="Visibility" Value="Collapsed" />
                                                    </DataTrigger>
                                                </Style.Triggers>
                                            </Style>
                                        </r:RibbonButton.Style>
                                    </r:RibbonButton>
                                </DataTemplate>
                            </ItemsControl.ItemTemplate>
                        </ItemsControl>
                    </r:RibbonContentPresenter.Content>
                </r:RibbonContentPresenter>
                <r:RibbonButton Command="{Binding Path=DataManager.ManageExternalApplicationsCommand}"
                                Label="{l:Loc exportManageExternalApps}"
                                LargeImageSource="/Resources/Icons/List2.png" />
            </r:RibbonGroup>
        </r:RibbonTab>
    </r:Ribbon>
</ResourceDictionary>